﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index2.aspx.cs" Inherits="Index2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/jquery.easyui/jquery.min.js" type="text/javascript"></script>
    <script src="js/jquery.easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="js/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <%--<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>--%>
    <%--<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>--%>
    <link href="css/admin.css" rel="stylesheet" type="text/css" />
    <link href="js/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="js/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <%--<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css" />--%>
  <style type="text/css">
    .tree-node {
      word-wrap: normal;
    }
  </style>
    <script type = "text/javascript">
        function enterkey() {
            e = event.keyCode;
            if (e == 13 || e == 32) {
                _$btnlogin.click();
            }
        }
        var lcallback;
        function OpenLogin(callback) {
            lcallback = callback;
            _$login.window('open');
            $("#txtUserId").focus();
            document.getElementById('chkCode').src = 'checkcode.aspx?' + new Date().getTime();
        }
        
        function CloseLogin() {
            $("#txtUserId").val("");
            $("#txtpassWord").val("");
            $("#txtCheckCode").val("");
            _$login.window('close');
        }
        function LoadPwd() {
            $('#divContent').html('<iframe src= "M_UpdatePassWord.aspx" width="100%" height="100%" frameborder="0" scrolling="auto" ></iframe>');                
        }
        function LoadUrl(title, url) {
            var chkurl = "TableHanders.aspx?act=chklg&type=1&tid=chklg&curl=" + url + "&ts=" + new Date().getTime();
            $.getJSON(chkurl, function(data) {
                var retData = EvalData(data);
                if (retData.code == 0) {
                    $('#divContent').html('<iframe src="' + url + '" width="100%" height="100%" frameborder="0" scrolling="auto" ></iframe>');
                }
                else if (retData.code == 1001) {
                    OpenLogin(function() {
                      $('#divContent').html('<iframe src="' + url + '" width="100%" height="100%" frameborder="0" scrolling="auto" ></iframe>');
                    });
                }
                else if (retData.code == 1002) {
                    alert('您无此权限,请与系统管理员联系');
                }
            });
        }

        var seteBayUserID = function (eBayUserID) {
          var url = getRootPath() + "/TableHanders.aspx?act=m&type=1&tid=m&ebayuserid=" + eBayUserID;
          $.getJSON(url, function (data) {
            var retData = EvalData(data);
            if (retData.code == 0) {
                //refreshMessage();
                //refreshDispute();
                //refreshFeedback();
            }
            else {
              alert(retData.msg);
            }
          });
        };

        var _$login;
        var _$btnlogin;
        $(function() {
            _$login = $('#pLogin');
            _$login.window({
                width: 300,
                height: 180,
                title: '用户登陆',
                modal: true,
                shadow: false,
                closed: true,
                collapsible: false,
                minimizable: false,
                maximizable: false,
                closable: false
            });
            $(document.body).layout();
            _$btnlogin = $("#btnLogin");
            _$btnlogin.click(function() {
                var userId = $("#txtUserId").val();
                var userPass = $("#txtpassWord").val();
                var userCode = $("#txtCheckCode").val();
                if (userId == "") {
                    alert('用户名不能为空');
                    return false;
                }
                if (userPass == "") {
                    alert('密码不能为空');
                    return false;
                } if (userCode == "") {
                    alert('验证码不能为空');
                    return false;
                }

                var url = getRootPath() + "/TableHanders.aspx?act=l&type=1&&tid=l&uid=" + userId + "&pwd=" + hex_md5(hex_md5(userPass) + userCode.toLowerCase()) + "&code=" + userCode + "&ts=" + new Date().getTime();

                $.getJSON(url, function(data) {
                    var retData = EvalData(data);
                    var code = retData.code;
                    if (code == 0) {
                        CloseLogin();
                        lcallback();
                    }
                    else if (code == 1003) {
                        alert(retData.msg);
                        $("#txtCheckCode").val("");
                        $("#txtCheckCode").focus();
                        document.getElementById('chkCode').src = 'checkcode.aspx?' + new Date().getTime();
                    }
                    else if (code == 1004) {
                        alert(retData.msg);
                        $("#txtpassWord").val("");
                        $("#txtpassWord").focus();
                    }
                    else if (code == 1005) {
                        alert(retData.msg);
                        $("#txtUserId").val("");
                        $("#txtUserId").focus();
                    }
                    else {
                        alert(retData.msg);
                    }
                });
            });
        });
    </script>
</head>
<body onkeydown = "enterkey();">
	<div data-options="region:'north',href:'top2.aspx',border:false" style="height:50px;" ></div>
	<div data-options="region:'west',href:'left2.aspx',split:true" title="菜单栏"  style="width:220px;padding:10px;">
	</div>
	<div id = "divContent" data-options="region:'center'">
	</div>
	<div id="pLogin">
        <div style="height:100px;line-height:30px;">
            <table id="tlogin">
                <tr>
                    <td><span>用户名:</span></td>
                    <td><input id = "txtUserId" style = "width:210px"/></td>
                </tr>
                <tr>
                    <td><span>密码:</span></td>
                    <td><input type="password" id = "txtpassWord" style = "width:210px"/></td>
                </tr>
                <tr>
                    <td><span>验证码:</span></td>
                    <td style="height:25px;line-height:25px;">
                        <input id = "txtCheckCode" />
                        <a href="javascript:document.getElementById('chkCode').src='checkcode.aspx?'+new Date();void(0);">
                            <img src="checkcode.aspx" id="chkCode" alt="" style="vertical-align:middle;"/>
                        </a>
                    </td>
                </tr>
            </table>
        </div>
        <div style="text-align:right;height:20px;line-height:20px; padding:12px;">
			<a id="btnLogin" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" >Login</a>
			<a id="btnClose" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick = "CloseLogin();" >Close</a>
		</div>
    </div>
</body>
</html>
